﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entities;
using System.Data;
using System.Data.SqlClient;
using Entities;
namespace DataAccess
{
   public  class CardReaderDA
    {
        ConnectDB cn = new ConnectDB();
        CardEntites CarE = new CardEntites();
        // THANH
        public bool GetAccountNo(CardEntites carE)
        {
            try
            {
                SqlConnection con = new SqlConnection(cn.ConnectionString());
                con.Open();
                SqlCommand cmd = new SqlCommand("ProCardSelectByCarNo", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("@CardNo", carE.CardNo));
                SqlDataReader dt = cmd.ExecuteReader();
                if (dt.Read())
                {
                    cmd.Dispose();
                    return true;
                }
                else
                {
                    return false;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }




        }
    }
}
